{{include file="public/header" /}}

<!-- right content start  -->
<div class="content-right">
	<div class="content">
        <!-- operation start -->
        <div class="am-g">
            <button class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus tree-submit-add" data-am-modal="{target: '#data-save-win'}"> {{:MyLang('add_title')}}</button>
        </div>
        <!-- operation end -->

        <!-- save win start -->
        <div class="am-popup am-radius" id="data-save-win">
			<div class="am-popup-inner">
				<div class="am-popup-hd">
					<h4 class="am-popup-title" data-add-title="{{:MyLang('region.base_nav_title')}}{{:MyLang('add_title')}}" data-edit-title="{{:MyLang('region.base_nav_title')}}{{:MyLang('edit_title')}}">{{:MyLang('region.base_nav_title')}}{{:MyLang('add_title')}}</h4>
					<span data-am-modal-close class="am-close">&times;</span>
				</div>
				<div class="am-popup-bd">
					<!-- form start -->
					<form class="am-form form-validation am-form-pure am-form-full-screen am-form-popup-fixed" action="{{:MyUrl('admin/region/save')}}" method="POST" request-type="ajax-fun" request-value="TreeFormSaveBack">
						<div class="am-cf">
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.region.form_item_name')}}<span class="am-form-group-label-tips-must">*</span></label>
									<input type="text" placeholder="{{:MyLang('common_service.region.form_item_name_message')}}" name="name" minlength="2" maxlength="16" data-validation-message="{{:MyLang('common_service.region.form_item_name_message')}}" class="am-radius" required />
								</div>
							</div>
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.region.form_item_code')}}</label>
									<input type="text" placeholder="{{:MyLang('common_service.region.form_item_code')}}" name="code" maxlength="30" data-validation-message="{{:MyLang('common_service.region.form_item_code_message')}}" class="am-radius" />
								</div>
							</div>
						</div>
						<div class="am-cf">
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.region.form_item_lng')}}</label>
									<input type="number" placeholder="{{:MyLang('common_service.region.form_item_lng')}}" name="lng" step="0.01" data-validation-message="{{:MyLang('common_service.region.form_item_lng_message')}}" class="am-radius" />
								</div>
							</div>
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.region.form_item_lat')}}</label>
									<input type="number" placeholder="{{:MyLang('common_service.region.form_item_lat')}}" name="lat" step="0.01" data-validation-message="{{:MyLang('common_service.region.form_item_lat_message')}}" class="am-radius" />
								</div>
							</div>
						</div>
						<div class="am-cf">
							<div class="am-u-sm-6 am-padding-horizontal-0">
								<div class="am-form-group">
									<label>{{:MyLang('common_service.region.form_item_letters')}}</label>
									<input type="text" placeholder="{{:MyLang('common_service.region.form_item_letters')}}" name="letters" data-validation-message="{{:MyLang('common_service.region.form_item_letters_message')}}" class="am-radius" value="" />
								</div>
							</div>
							<div class="am-u-sm-6 am-padding-horizontal-0">
								{{include file="lib/sort" /}}
							</div>
						</div>
						
						{{include file="lib/is_enable" /}}
						<div class="am-form-popup-submit">
							<input type="hidden" name="id" value="0" />
							<input type="hidden" name="pid" value="0" />
							<button type="submit" class="am-btn am-btn-primary am-radius btn-loading-example am-btn-sm am-btn-block" data-am-loading="{loadingText:'{{:MyLang('processing_tips')}}'}">{{:MyLang('save_title')}}</button>
						</div>
					</form>
					<!-- form end -->
				</div>
			</div>
		</div>
		<!-- save win end -->

        <!-- list start -->
		<div id="tree" class="am-margin-top-sm" data-node-url="{{:MyUrl('admin/region/getnodeson')}}" data-del-url="{{:MyUrl('admin/region/delete')}}" data-popup-tag="#data-save-win" data-rank="3">
			{{include file="public/loading" /}}
		</div>
		<!-- list end -->
	</div>
</div>
<!-- right content end  -->

<!-- footer start -->
{{include file="public/footer" /}}
<!-- footer end -->

<script type="text/javascript">
	// 初始化
	Tree(0, $('#tree').data('node-url'), 0, 1);

	// 回调处理
	function TreeFormSaveBack(e)
	{
		TreeFormSaveBackHandle(e);
	}
</script>